package com.bor.gb.rest.security;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * Created by bor on 11/22/14.
 */
public class CurrentUser {

    public static String getUserId(){
      return getDetails().getId();
    }

    private static UserContextDetails getDetails(){
        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        return  (UserContextDetails) auth.getDetails();
    }
}
